.class public Lde/madvertise/android/sdk/MadView;
.super Landroid/widget/LinearLayout;


# instance fields
.field private final a:I

.field private final b:D

.field private c:Lde/madvertise/android/sdk/c;

.field private d:Landroid/graphics/drawable/BitmapDrawable;

.field private e:I

.field private f:I

.field private g:I

.field private h:Z

.field private i:Ljava/lang/String;

.field private j:Z

.field private k:I

.field private l:I

.field private m:Lde/madvertise/android/sdk/d;

.field private n:Ljava/util/Timer;

.field private final o:Landroid/os/Handler;

.field private p:Z

.field private q:Landroid/graphics/drawable/Drawable;

.field private final r:Ljava/lang/Runnable;


# direct methods
.method public constructor <init>(Landroid/content/Context;)V
    .locals 1

    const/4 v0, 0x0

    invoke-direct {p0, p1, v0}, Lde/madvertise/android/sdk/MadView;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V

    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
    .locals 7

    const/16 v6, 0x12

    const/4 v5, 0x1

    const/4 v2, 0x0

    const/16 v4, 0x1e

    const/4 v3, 0x0

    invoke-direct {p0, p1, p2}, Landroid/widget/LinearLayout;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V

    const/16 v0, 0x7f

    iput v0, p0, Lde/madvertise/android/sdk/MadView;->a:I

    const-wide v0, 0x3fe799999999999aL

    iput-wide v0, p0, Lde/madvertise/android/sdk/MadView;->b:D

    const v0, 0xcfcfcf

    iput v0, p0, Lde/madvertise/android/sdk/MadView;->e:I

    const v0, 0xffffff

    iput v0, p0, Lde/madvertise/android/sdk/MadView;->f:I

    iput v4, p0, Lde/madvertise/android/sdk/MadView;->g:I

    iput-boolean v3, p0, Lde/madvertise/android/sdk/MadView;->h:Z

    const-string v0, "mma"

    iput-object v0, p0, Lde/madvertise/android/sdk/MadView;->i:Ljava/lang/String;

    iput-boolean v3, p0, Lde/madvertise/android/sdk/MadView;->j:Z

    iput v6, p0, Lde/madvertise/android/sdk/MadView;->k:I

    const/16 v0, 0x35

    iput v0, p0, Lde/madvertise/android/sdk/MadView;->l:I

    iput-object v2, p0, Lde/madvertise/android/sdk/MadView;->m:Lde/madvertise/android/sdk/d;

    iput-object v2, p0, Lde/madvertise/android/sdk/MadView;->n:Ljava/util/Timer;

    new-instance v0, Landroid/os/Handler;

    invoke-direct {v0}, Landroid/os/Handler;-><init>()V

    iput-object v0, p0, Lde/madvertise/android/sdk/MadView;->o:Landroid/os/Handler;

    iput-boolean v3, p0, Lde/madvertise/android/sdk/MadView;->p:Z

    iput-object v2, p0, Lde/madvertise/android/sdk/MadView;->q:Landroid/graphics/drawable/Drawable;

    new-instance v0, Lde/madvertise/android/sdk/h;

    invoke-direct {v0, p0}, Lde/madvertise/android/sdk/h;-><init>(Lde/madvertise/android/sdk/MadView;)V

    iput-object v0, p0, Lde/madvertise/android/sdk/MadView;->r:Ljava/lang/Runnable;

    const-string v0, "** Constructor for mad view called **"

    invoke-static {v0}, Lde/madvertise/android/sdk/e;->a(Ljava/lang/String;)V

    const/4 v0, 0x4

    invoke-virtual {p0, v0}, Lde/madvertise/android/sdk/MadView;->setVisibility(I)V

    const-string v0, "android.permission.INTERNET"

    invoke-virtual {p1, v0}, Landroid/content/Context;->checkCallingOrSelfPermission(Ljava/lang/String;)I

    move-result v0

    const/4 v1, -0x1

    if-ne v0, v1, :cond_0

    const-string v0, " *** ----------------------------- *** "

    invoke-static {v0}, Lde/madvertise/android/sdk/e;->a(Ljava/lang/String;)V

    const-string v0, " *** Missing internet permissions! *** "

    invoke-static {v0}, Lde/madvertise/android/sdk/e;->a(Ljava/lang/String;)V

    const-string v0, " *** ----------------------------- *** "

    invoke-static {v0}, Lde/madvertise/android/sdk/e;->a(Ljava/lang/String;)V

    new-instance v0, Ljava/lang/IllegalArgumentException;

    invoke-direct {v0}, Ljava/lang/IllegalArgumentException;-><init>()V

    throw v0

    :cond_0
    if-eqz p2, :cond_5

    new-instance v0, Ljava/lang/StringBuilder;

    const-string v1, "http://schemas.android.com/apk/res/"

    invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {p0}, Lde/madvertise/android/sdk/MadView;->getContext()Landroid/content/Context;

    move-result-object v1

    invoke-virtual {v1}, Landroid/content/Context;->getPackageName()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    if-eqz v0, :cond_1

    new-instance v1, Ljava/lang/StringBuilder;

    const-string v2, "namespace = "

    invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v1}, Lde/madvertise/android/sdk/e;->a(Ljava/lang/String;)V

    :cond_1
    const-string v1, "isTestMode"

    invoke-interface {p2, v0, v1, v3}, Landroid/util/AttributeSet;->getAttributeBooleanValue(Ljava/lang/String;Ljava/lang/String;Z)Z

    move-result v1

    iput-boolean v1, p0, Lde/madvertise/android/sdk/MadView;->h:Z

    const-string v1, "textColor"

    const v2, 0xcfcfcf

    invoke-interface {p2, v0, v1, v2}, Landroid/util/AttributeSet;->getAttributeIntValue(Ljava/lang/String;Ljava/lang/String;I)I

    move-result v1

    iput v1, p0, Lde/madvertise/android/sdk/MadView;->e:I

    const-string v1, "backgroundColor"

    const v2, 0xffffff

    invoke-interface {p2, v0, v1, v2}, Landroid/util/AttributeSet;->getAttributeIntValue(Ljava/lang/String;Ljava/lang/String;I)I

    move-result v1

    iput v1, p0, Lde/madvertise/android/sdk/MadView;->f:I

    const-string v1, "secondsToRefresh"

    invoke-interface {p2, v0, v1, v4}, Landroid/util/AttributeSet;->getAttributeIntValue(Ljava/lang/String;Ljava/lang/String;I)I

    move-result v1

    iput v1, p0, Lde/madvertise/android/sdk/MadView;->g:I

    const-string v1, "bannerType"

    invoke-interface {p2, v0, v1}, Landroid/util/AttributeSet;->getAttributeValue(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    iput-object v1, p0, Lde/madvertise/android/sdk/MadView;->i:Ljava/lang/String;

    iget-object v1, p0, Lde/madvertise/android/sdk/MadView;->i:Ljava/lang/String;

    if-nez v1, :cond_2

    const-string v1, "mma"

    iput-object v1, p0, Lde/madvertise/android/sdk/MadView;->i:Ljava/lang/String;

    :cond_2
    const-string v1, "deliverOnlyText"

    invoke-interface {p2, v0, v1, v3}, Landroid/util/AttributeSet;->getAttributeBooleanValue(Ljava/lang/String;Ljava/lang/String;Z)Z

    move-result v1

    iput-boolean v1, p0, Lde/madvertise/android/sdk/MadView;->j:Z

    const-string v1, "textSize"

    invoke-interface {p2, v0, v1, v6}, Landroid/util/AttributeSet;->getAttributeIntValue(Ljava/lang/String;Ljava/lang/String;I)I

    move-result v0

    iput v0, p0, Lde/madvertise/android/sdk/MadView;->k:I

    :goto_0
    iget v0, p0, Lde/madvertise/android/sdk/MadView;->g:I

    if-eqz v0, :cond_3

    iget v0, p0, Lde/madvertise/android/sdk/MadView;->g:I

    const/16 v1, 0x3c

    if-ge v0, v1, :cond_3

    iput v4, p0, Lde/madvertise/android/sdk/MadView;->g:I

    :cond_3
    iget-object v0, p0, Lde/madvertise/android/sdk/MadView;->i:Ljava/lang/String;

    const-string v1, "iab"

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_4

    const/16 v0, 0xfa

    iput v0, p0, Lde/madvertise/android/sdk/MadView;->l:I

    :cond_4
    const-string v0, "Using following attributes values:"

    invoke-static {v0}, Lde/madvertise/android/sdk/e;->a(Ljava/lang/String;)V

    new-instance v0, Ljava/lang/StringBuilder;

    const-string v1, " testMode = "

    invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    iget-boolean v1, p0, Lde/madvertise/android/sdk/MadView;->h:Z

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Z)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Lde/madvertise/android/sdk/e;->a(Ljava/lang/String;)V

    new-instance v0, Ljava/lang/StringBuilder;

    const-string v1, " textColor = "

    invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    iget v1, p0, Lde/madvertise/android/sdk/MadView;->e:I

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Lde/madvertise/android/sdk/e;->a(Ljava/lang/String;)V

    new-instance v0, Ljava/lang/StringBuilder;

    const-string v1, " backgroundColor = "

    invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    iget v1, p0, Lde/madvertise/android/sdk/MadView;->f:I

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Lde/madvertise/android/sdk/e;->a(Ljava/lang/String;)V

    new-instance v0, Ljava/lang/StringBuilder;

    const-string v1, " secondsToRefreshAd = "

    invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    iget v1, p0, Lde/madvertise/android/sdk/MadView;->g:I

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Lde/madvertise/android/sdk/e;->a(Ljava/lang/String;)V

    new-instance v0, Ljava/lang/StringBuilder;

    const-string v1, " bannerType = "

    invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    iget-object v1, p0, Lde/madvertise/android/sdk/MadView;->i:Ljava/lang/String;

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Lde/madvertise/android/sdk/e;->a(Ljava/lang/String;)V

    new-instance v0, Ljava/lang/StringBuilder;

    const-string v1, " deliverOnlyText = "

    invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    iget-boolean v1, p0, Lde/madvertise/android/sdk/MadView;->j:Z

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Z)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Lde/madvertise/android/sdk/e;->a(Ljava/lang/String;)V

    new-instance v0, Ljava/lang/StringBuilder;

    const-string v1, " textSize = "

    invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    iget v1, p0, Lde/madvertise/android/sdk/MadView;->k:I

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Lde/madvertise/android/sdk/e;->a(Ljava/lang/String;)V

    new-instance v0, Ljava/lang/StringBuilder;

    const-string v1, " bannerHeight = "

    invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    iget v1, p0, Lde/madvertise/android/sdk/MadView;->l:I

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Lde/madvertise/android/sdk/e;->a(Ljava/lang/String;)V

    invoke-virtual {p0}, Lde/madvertise/android/sdk/MadView;->getContext()Landroid/content/Context;

    move-result-object v0

    const-string v1, "window"

    invoke-virtual {v0, v1}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/view/WindowManager;

    invoke-interface {v0}, Landroid/view/WindowManager;->getDefaultDisplay()Landroid/view/Display;

    move-result-object v0

    new-instance v1, Ljava/lang/StringBuilder;

    const-string v2, "Display values: Width = "

    invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v0}, Landroid/view/Display;->getWidth()I

    move-result v2

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string v2, " ; Height = "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v0}, Landroid/view/Display;->getHeight()I

    move-result v2

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v1}, Lde/madvertise/android/sdk/e;->a(Ljava/lang/String;)V

    const/16 v1, 0x11

    invoke-virtual {p0, v1}, Lde/madvertise/android/sdk/MadView;->setGravity(I)V

    invoke-virtual {p0}, Lde/madvertise/android/sdk/MadView;->getBackground()Landroid/graphics/drawable/Drawable;

    move-result-object v1

    iput-object v1, p0, Lde/madvertise/android/sdk/MadView;->q:Landroid/graphics/drawable/Drawable;

    new-instance v1, Landroid/graphics/Rect;

    invoke-virtual {v0}, Landroid/view/Display;->getWidth()I

    move-result v2

    invoke-virtual {v0}, Landroid/view/Display;->getHeight()I

    move-result v0

    invoke-direct {v1, v3, v3, v2, v0}, Landroid/graphics/Rect;-><init>(IIII)V

    iget v0, p0, Lde/madvertise/android/sdk/MadView;->f:I

    invoke-static {v1, v0}, Lde/madvertise/android/sdk/MadView;->a(Landroid/graphics/Rect;I)Landroid/graphics/drawable/BitmapDrawable;

    move-result-object v0

    iput-object v0, p0, Lde/madvertise/android/sdk/MadView;->d:Landroid/graphics/drawable/BitmapDrawable;

    invoke-virtual {p0, v5}, Lde/madvertise/android/sdk/MadView;->setClickable(Z)V

    invoke-virtual {p0, v5}, Lde/madvertise/android/sdk/MadView;->setFocusable(Z)V

    const/high16 v0, 0x2

    invoke-virtual {p0, v0}, Lde/madvertise/android/sdk/MadView;->setDescendantFocusability(I)V

    return-void

    :cond_5
    const-string v0, "AttributeSet is null!"

    invoke-static {v0}, Lde/madvertise/android/sdk/e;->a(Ljava/lang/String;)V

    goto/16 :goto_0
.end method

.method private static a(Landroid/graphics/Rect;I)Landroid/graphics/drawable/BitmapDrawable;
    .locals 7

    :try_start_0
    invoke-virtual {p0}, Landroid/graphics/Rect;->width()I

    move-result v0

    invoke-virtual {p0}, Landroid/graphics/Rect;->height()I

    move-result v1

    sget-object v2, Landroid/graphics/Bitmap$Config;->ARGB_8888:Landroid/graphics/Bitmap$Config;

    invoke-static {v0, v1, v2}, Landroid/graphics/Bitmap;->createBitmap(IILandroid/graphics/Bitmap$Config;)Landroid/graphics/Bitmap;

    move-result-object v1

    new-instance v0, Landroid/graphics/Canvas;

    invoke-direct {v0, v1}, Landroid/graphics/Canvas;-><init>(Landroid/graphics/Bitmap;)V

    new-instance v2, Landroid/graphics/Paint;

    invoke-direct {v2}, Landroid/graphics/Paint;-><init>()V

    invoke-virtual {v2, p1}, Landroid/graphics/Paint;->setColor(I)V

    const/4 v3, 0x1

    invoke-virtual {v2, v3}, Landroid/graphics/Paint;->setAntiAlias(Z)V

    invoke-virtual {v0, p0, v2}, Landroid/graphics/Canvas;->drawRect(Landroid/graphics/Rect;Landroid/graphics/Paint;)V

    const/16 v2, 0x7f

    const v3, 0xffffff

    invoke-static {v3}, Landroid/graphics/Color;->red(I)I

    move-result v3

    const v4, 0xffffff

    invoke-static {v4}, Landroid/graphics/Color;->green(I)I

    move-result v4

    const v5, 0xffffff

    invoke-static {v5}, Landroid/graphics/Color;->blue(I)I

    move-result v5

    invoke-static {v2, v3, v4, v5}, Landroid/graphics/Color;->argb(IIII)I

    move-result v2

    const/4 v3, 0x2

    new-array v3, v3, [I

    const/4 v4, 0x0

    aput v2, v3, v4

    const/4 v2, 0x1

    const v4, 0xffffff

    aput v4, v3, v2

    new-instance v2, Landroid/graphics/drawable/GradientDrawable;

    sget-object v4, Landroid/graphics/drawable/GradientDrawable$Orientation;->TOP_BOTTOM:Landroid/graphics/drawable/GradientDrawable$Orientation;

    invoke-direct {v2, v4, v3}, Landroid/graphics/drawable/GradientDrawable;-><init>(Landroid/graphics/drawable/GradientDrawable$Orientation;[I)V

    invoke-virtual {p0}, Landroid/graphics/Rect;->height()I

    move-result v3

    int-to-double v3, v3

    const-wide v5, 0x3fe799999999999aL

    mul-double/2addr v3, v5

    double-to-int v3, v3

    iget v4, p0, Landroid/graphics/Rect;->top:I

    add-int/2addr v3, v4

    iget v4, p0, Landroid/graphics/Rect;->left:I

    iget v5, p0, Landroid/graphics/Rect;->top:I

    iget v6, p0, Landroid/graphics/Rect;->right:I

    invoke-virtual {v2, v4, v5, v6, v3}, Landroid/graphics/drawable/GradientDrawable;->setBounds(IIII)V

    invoke-virtual {v2, v0}, Landroid/graphics/drawable/GradientDrawable;->draw(Landroid/graphics/Canvas;)V

    new-instance v2, Landroid/graphics/Rect;

    iget v4, p0, Landroid/graphics/Rect;->left:I

    iget v5, p0, Landroid/graphics/Rect;->right:I

    iget v6, p0, Landroid/graphics/Rect;->bottom:I

    invoke-direct {v2, v4, v3, v5, v6}, Landroid/graphics/Rect;-><init>(IIII)V

    new-instance v3, Landroid/graphics/Paint;

    invoke-direct {v3}, Landroid/graphics/Paint;-><init>()V

    const v4, 0xffffff

    invoke-virtual {v3, v4}, Landroid/graphics/Paint;->setColor(I)V

    invoke-virtual {v0, v2, v3}, Landroid/graphics/Canvas;->drawRect(Landroid/graphics/Rect;Landroid/graphics/Paint;)V

    new-instance v0, Landroid/graphics/drawable/BitmapDrawable;

    invoke-direct {v0, v1}, Landroid/graphics/drawable/BitmapDrawable;-><init>(Landroid/graphics/Bitmap;)V
    :try_end_0
    .catch Ljava/lang/Throwable; {:try_start_0 .. :try_end_0} :catch_0

    :goto_0
    return-object v0

    :catch_0
    move-exception v0

    const/4 v0, 0x0

    goto :goto_0
.end method

.method static synthetic a(Ljava/lang/String;)Ljava/lang/String;
    .locals 1

    invoke-static {p0}, Lde/madvertise/android/sdk/MadView;->b(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method static synthetic a(Lde/madvertise/android/sdk/MadView;)V
    .locals 3

    const/4 v2, 0x0

    iget-object v0, p0, Lde/madvertise/android/sdk/MadView;->q:Landroid/graphics/drawable/Drawable;

    invoke-virtual {p0, v0}, Lde/madvertise/android/sdk/MadView;->setBackgroundDrawable(Landroid/graphics/drawable/Drawable;)V

    iget-object v0, p0, Lde/madvertise/android/sdk/MadView;->c:Lde/madvertise/android/sdk/c;

    if-eqz v0, :cond_1

    iget-object v0, p0, Lde/madvertise/android/sdk/MadView;->c:Lde/madvertise/android/sdk/c;

    invoke-virtual {v0}, Lde/madvertise/android/sdk/c;->c()Z

    move-result v0

    if-eqz v0, :cond_0

    iget-boolean v0, p0, Lde/madvertise/android/sdk/MadView;->j:Z

    if-nez v0, :cond_0

    const-string v0, "Add static banner"

    invoke-static {v0}, Lde/madvertise/android/sdk/e;->a(Ljava/lang/String;)V

    iget-object v0, p0, Lde/madvertise/android/sdk/MadView;->c:Lde/madvertise/android/sdk/c;

    invoke-virtual {v0}, Lde/madvertise/android/sdk/c;->d()[B

    move-result-object v0

    iget-object v1, p0, Lde/madvertise/android/sdk/MadView;->c:Lde/madvertise/android/sdk/c;

    invoke-virtual {v1}, Lde/madvertise/android/sdk/c;->d()[B

    move-result-object v1

    array-length v1, v1

    invoke-static {v0, v2, v1}, Landroid/graphics/BitmapFactory;->decodeByteArray([BII)Landroid/graphics/Bitmap;

    move-result-object v0

    new-instance v1, Lde/madvertise/android/sdk/a;

    invoke-virtual {p0}, Lde/madvertise/android/sdk/MadView;->getContext()Landroid/content/Context;

    move-result-object v2

    invoke-direct {v1, v2, v0}, Lde/madvertise/android/sdk/a;-><init>(Landroid/content/Context;Landroid/graphics/Bitmap;)V

    invoke-virtual {p0}, Lde/madvertise/android/sdk/MadView;->removeAllViews()V

    invoke-virtual {p0, v1}, Lde/madvertise/android/sdk/MadView;->addView(Landroid/view/View;)V

    :goto_0
    const/4 v0, 0x1

    invoke-direct {p0, v0}, Lde/madvertise/android/sdk/MadView;->a(Z)V

    :goto_1
    return-void

    :cond_0
    const-string v0, "Add text banner"

    invoke-static {v0}, Lde/madvertise/android/sdk/e;->a(Ljava/lang/String;)V

    new-instance v0, Landroid/widget/TextView;

    invoke-virtual {p0}, Lde/madvertise/android/sdk/MadView;->getContext()Landroid/content/Context;

    move-result-object v1

    invoke-direct {v0, v1}, Landroid/widget/TextView;-><init>(Landroid/content/Context;)V

    const/16 v1, 0x11

    invoke-virtual {v0, v1}, Landroid/widget/TextView;->setGravity(I)V

    iget-object v1, p0, Lde/madvertise/android/sdk/MadView;->c:Lde/madvertise/android/sdk/c;

    invoke-virtual {v1}, Lde/madvertise/android/sdk/c;->b()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    iget v1, p0, Lde/madvertise/android/sdk/MadView;->k:I

    int-to-float v1, v1

    invoke-virtual {v0, v1}, Landroid/widget/TextView;->setTextSize(F)V

    iget v1, p0, Lde/madvertise/android/sdk/MadView;->e:I

    invoke-virtual {v0, v1}, Landroid/widget/TextView;->setTextColor(I)V

    sget-object v1, Landroid/graphics/Typeface;->DEFAULT_BOLD:Landroid/graphics/Typeface;

    invoke-virtual {v0, v1}, Landroid/widget/TextView;->setTypeface(Landroid/graphics/Typeface;)V

    iget-object v1, p0, Lde/madvertise/android/sdk/MadView;->d:Landroid/graphics/drawable/BitmapDrawable;

    invoke-virtual {p0, v1}, Lde/madvertise/android/sdk/MadView;->setBackgroundDrawable(Landroid/graphics/drawable/Drawable;)V

    invoke-virtual {p0}, Lde/madvertise/android/sdk/MadView;->removeAllViews()V

    invoke-virtual {p0, v0}, Lde/madvertise/android/sdk/MadView;->addView(Landroid/view/View;)V

    goto :goto_0

    :cond_1
    invoke-virtual {p0}, Lde/madvertise/android/sdk/MadView;->removeAllViews()V

    invoke-direct {p0, v2}, Lde/madvertise/android/sdk/MadView;->a(Z)V

    goto :goto_1
.end method

.method static synthetic a(Lde/madvertise/android/sdk/MadView;Lde/madvertise/android/sdk/c;)V
    .locals 0

    iput-object p1, p0, Lde/madvertise/android/sdk/MadView;->c:Lde/madvertise/android/sdk/c;

    return-void
.end method

.method private a(Z)V
    .locals 1

    iget-object v0, p0, Lde/madvertise/android/sdk/MadView;->m:Lde/madvertise/android/sdk/d;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lde/madvertise/android/sdk/MadView;->m:Lde/madvertise/android/sdk/d;

    invoke-interface {v0, p1, p0}, Lde/madvertise/android/sdk/d;->a(ZLde/madvertise/android/sdk/MadView;)V

    :goto_0
    return-void

    :cond_0
    const-string v0, "Callback Listener not set"

    invoke-static {v0}, Lde/madvertise/android/sdk/e;->a(Ljava/lang/String;)V

    goto :goto_0
.end method

.method private static b(Ljava/lang/String;)Ljava/lang/String;
    .locals 6

    :try_start_0
    const-string v0, "MD5"

    invoke-static {v0}, Ljava/security/MessageDigest;->getInstance(Ljava/lang/String;)Ljava/security/MessageDigest;
    :try_end_0
    .catch Ljava/security/NoSuchAlgorithmException; {:try_start_0 .. :try_end_0} :catch_0

    move-result-object v0

    invoke-virtual {p0}, Ljava/lang/String;->getBytes()[B

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/security/MessageDigest;->update([B)V

    invoke-virtual {v0}, Ljava/security/MessageDigest;->digest()[B

    move-result-object v2

    new-instance v3, Ljava/lang/StringBuffer;

    invoke-direct {v3}, Ljava/lang/StringBuffer;-><init>()V

    const/4 v0, 0x0

    :goto_0
    array-length v1, v2

    if-lt v0, v1, :cond_0

    invoke-virtual {v3}, Ljava/lang/StringBuffer;->toString()Ljava/lang/String;

    move-result-object v0

    :goto_1
    return-object v0

    :catch_0
    move-exception v0

    invoke-virtual {v0}, Ljava/security/NoSuchAlgorithmException;->printStackTrace()V

    const-string v0, "Could not create hash value"

    invoke-static {v0}, Lde/madvertise/android/sdk/e;->a(Ljava/lang/String;)V

    const-string v0, ""

    goto :goto_1

    :cond_0
    aget-byte v1, v2, v0

    and-int/lit16 v1, v1, 0xff

    invoke-static {v1}, Ljava/lang/Integer;->toHexString(I)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/String;->length()I

    move-result v4

    const/4 v5, 0x2

    if-ge v4, v5, :cond_1

    new-instance v4, Ljava/lang/StringBuilder;

    const-string v5, "0"

    invoke-direct {v4, v5}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v4, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    :cond_1
    invoke-virtual {v3, v1}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    add-int/lit8 v0, v0, 0x1

    goto :goto_0
.end method

.method private b(Z)V
    .locals 8

    monitor-enter p0

    if-eqz p1, :cond_1

    :try_start_0
    iget-object v0, p0, Lde/madvertise/android/sdk/MadView;->n:Ljava/util/Timer;

    if-nez v0, :cond_0

    new-instance v0, Ljava/util/Timer;

    invoke-direct {v0}, Ljava/util/Timer;-><init>()V

    iput-object v0, p0, Lde/madvertise/android/sdk/MadView;->n:Ljava/util/Timer;

    iget-object v0, p0, Lde/madvertise/android/sdk/MadView;->n:Ljava/util/Timer;

    new-instance v1, Lde/madvertise/android/sdk/f;

    invoke-direct {v1, p0}, Lde/madvertise/android/sdk/f;-><init>(Lde/madvertise/android/sdk/MadView;)V

    const-wide/16 v2, 0x0

    iget v4, p0, Lde/madvertise/android/sdk/MadView;->g:I

    int-to-long v4, v4

    const-wide/16 v6, 0x3e8

    mul-long/2addr v4, v6

    invoke-virtual/range {v0 .. v5}, Ljava/util/Timer;->schedule(Ljava/util/TimerTask;JJ)V

    :cond_0
    :goto_0
    monitor-exit p0

    return-void

    :cond_1
    iget-object v0, p0, Lde/madvertise/android/sdk/MadView;->n:Ljava/util/Timer;

    if-eqz v0, :cond_0

    const-string v0, "Stopping refresh timer ..."

    invoke-static {v0}, Lde/madvertise/android/sdk/e;->a(Ljava/lang/String;)V

    iget-object v0, p0, Lde/madvertise/android/sdk/MadView;->n:Ljava/util/Timer;

    invoke-virtual {v0}, Ljava/util/Timer;->cancel()V

    const/4 v0, 0x0

    iput-object v0, p0, Lde/madvertise/android/sdk/MadView;->n:Ljava/util/Timer;

    goto :goto_0

    :catchall_0
    move-exception v0

    monitor-exit p0
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw v0
.end method

.method static synthetic b(Lde/madvertise/android/sdk/MadView;)Z
    .locals 1

    iget-boolean v0, p0, Lde/madvertise/android/sdk/MadView;->h:Z

    return v0
.end method

.method static synthetic c(Lde/madvertise/android/sdk/MadView;)Ljava/lang/String;
    .locals 1

    iget-object v0, p0, Lde/madvertise/android/sdk/MadView;->i:Ljava/lang/String;

    return-object v0
.end method

.method static synthetic d(Lde/madvertise/android/sdk/MadView;)Z
    .locals 1

    iget-boolean v0, p0, Lde/madvertise/android/sdk/MadView;->j:Z

    return v0
.end method

.method static synthetic e(Lde/madvertise/android/sdk/MadView;)Landroid/os/Handler;
    .locals 1

    iget-object v0, p0, Lde/madvertise/android/sdk/MadView;->o:Landroid/os/Handler;

    return-object v0
.end method

.method static synthetic f(Lde/madvertise/android/sdk/MadView;)Ljava/lang/Runnable;
    .locals 1

    iget-object v0, p0, Lde/madvertise/android/sdk/MadView;->r:Ljava/lang/Runnable;

    return-object v0
.end method

.method static synthetic g(Lde/madvertise/android/sdk/MadView;)V
    .locals 1

    const-string v0, "Trying to fetch a new ad"

    invoke-static {v0}, Lde/madvertise/android/sdk/e;->a(Ljava/lang/String;)V

    iget-boolean v0, p0, Lde/madvertise/android/sdk/MadView;->p:Z

    if-eqz v0, :cond_0

    const-string v0, "Another request is still in progress ..."

    invoke-static {v0}, Lde/madvertise/android/sdk/e;->a(Ljava/lang/String;)V

    :goto_0
    return-void

    :cond_0
    new-instance v0, Lde/madvertise/android/sdk/g;

    invoke-direct {v0, p0}, Lde/madvertise/android/sdk/g;-><init>(Lde/madvertise/android/sdk/MadView;)V

    invoke-virtual {v0}, Lde/madvertise/android/sdk/g;->start()V

    goto :goto_0
.end method


# virtual methods
.method public final a(Lde/madvertise/android/sdk/d;)V
    .locals 0

    iput-object p1, p0, Lde/madvertise/android/sdk/MadView;->m:Lde/madvertise/android/sdk/d;

    return-void
.end method

.method protected onAttachedToWindow()V
    .locals 1

    const-string v0, "#### onAttachedToWindow fired ####"

    invoke-static {v0}, Lde/madvertise/android/sdk/e;->a(Ljava/lang/String;)V

    const/4 v0, 0x1

    invoke-direct {p0, v0}, Lde/madvertise/android/sdk/MadView;->b(Z)V

    invoke-super {p0}, Landroid/widget/LinearLayout;->onAttachedToWindow()V

    return-void
.end method

.method protected onDetachedFromWindow()V
    .locals 1

    const-string v0, "#### onDetachedFromWindow fired ####"

    invoke-static {v0}, Lde/madvertise/android/sdk/e;->a(Ljava/lang/String;)V

    const/4 v0, 0x0

    invoke-direct {p0, v0}, Lde/madvertise/android/sdk/MadView;->b(Z)V

    invoke-super {p0}, Landroid/widget/LinearLayout;->onDetachedFromWindow()V

    return-void
.end method

.method protected onMeasure(II)V
    .locals 2

    invoke-super {p0, p1, p2}, Landroid/widget/LinearLayout;->onMeasure(II)V

    invoke-virtual {p0}, Lde/madvertise/android/sdk/MadView;->getMeasuredWidth()I

    move-result v0

    iget v1, p0, Lde/madvertise/android/sdk/MadView;->l:I

    invoke-virtual {p0, v0, v1}, Lde/madvertise/android/sdk/MadView;->setMeasuredDimension(II)V

    return-void
.end method

.method public onTouchEvent(Landroid/view/MotionEvent;)Z
    .locals 1

    const-string v0, "onTouchEvent(MotionEvent event) fired"

    invoke-static {v0}, Lde/madvertise/android/sdk/e;->a(Ljava/lang/String;)V

    iget-object v0, p0, Lde/madvertise/android/sdk/MadView;->c:Lde/madvertise/android/sdk/c;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lde/madvertise/android/sdk/MadView;->c:Lde/madvertise/android/sdk/c;

    invoke-virtual {v0}, Lde/madvertise/android/sdk/c;->a()V

    :cond_0
    const/4 v0, 0x1

    return v0
.end method

.method public onWindowFocusChanged(Z)V
    .locals 1

    const-string v0, "#### onWindowFocusChanged fired ####"

    invoke-static {v0}, Lde/madvertise/android/sdk/e;->a(Ljava/lang/String;)V

    invoke-direct {p0, p1}, Lde/madvertise/android/sdk/MadView;->b(Z)V

    invoke-super {p0, p1}, Landroid/widget/LinearLayout;->onWindowFocusChanged(Z)V

    return-void
.end method

.method public setVisibility(I)V
    .locals 3

    invoke-super {p0}, Landroid/widget/LinearLayout;->getVisibility()I

    move-result v0

    if-eq v0, p1, :cond_0

    monitor-enter p0

    :try_start_0
    invoke-virtual {p0}, Lde/madvertise/android/sdk/MadView;->getChildCount()I

    move-result v1

    const/4 v0, 0x0

    :goto_0
    if-lt v0, v1, :cond_1

    invoke-super {p0, p1}, Landroid/widget/LinearLayout;->setVisibility(I)V

    monitor-exit p0

    :cond_0
    return-void

    :cond_1
    invoke-virtual {p0, v0}, Lde/madvertise/android/sdk/MadView;->getChildAt(I)Landroid/view/View;

    move-result-object v2

    invoke-virtual {v2, p1}, Landroid/view/View;->setVisibility(I)V

    add-int/lit8 v0, v0, 0x1

    goto :goto_0

    :catchall_0
    move-exception v0

    monitor-exit p0
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw v0
.end method
